using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;

using Microsoft.SharePoint.Utilities;

namespace ThemeSolutionProvider
{
  public partial class ThemeDetailsForm : Form
  {
    public ThemeDetailsForm()
    {
      InitializeComponent();
    }

    private void ThemeDetailsForm_Load(object sender, EventArgs e)
    {
      string themesPath = SPUtility.GetGenericSetupPath(@"TEMPLATE\THEMES");
      DirectoryInfo themesDir = new DirectoryInfo(themesPath);
      comboBoxThemes.DataSource = themesDir.GetDirectories();
      comboBoxThemes.DisplayMember = "Name";
      comboBoxThemes.ValueMember = "FullName";
    }

    private void buttonOK_Click(object sender, EventArgs e)
    {
      DialogResult = DialogResult.OK;
    }

    private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
    {
      try
      {
        linkLabel1.LinkVisited = true;
        System.Diagnostics.Process.Start("http://solutionizing.net/");
      }
      catch (InvalidOperationException)
      { }
      catch (ArgumentNullException)
      { }
      catch (System.ComponentModel.Win32Exception)
      { }
    }

    private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
    {
      try
      {
        linkLabel1.LinkVisited = true;
        System.Diagnostics.Process.Start("http://www.heathersolomon.com/blog/archive/2008/01/30/SharePoint-2007-Design-Tip-Import-your-CSS-for-SharePoint-Themes.aspx");
      }
      catch (InvalidOperationException)
      { }
      catch (ArgumentNullException)
      { }
      catch (System.ComponentModel.Win32Exception)
      { }
    }

    #region Theme Properties

    public string ThemeToCopy
    {
      get
      {
        return comboBoxThemes.SelectedValue as string;
      }
    }

    public string ThemeID
    {
      get
      {
        return textBoxThemeID.Text;
      }
    }
    public string ThemeName
    {
      get
      {
        return textBoxName.Text;
      }
    }
    public string ThemeDescription
    {
      get
      {
        return textBoxDescription.Text;
      }
    }
    public string ThemeThumbnail
    {
      get
      {
        return textBoxThumbnail.Text;
      }
    }
    public string ThemePreview
    {
      get
      {
        return textBoxPreview.Text;
      }
    }
    public bool ConvertToCssImport
    {
      get
      {
        return checkBoxConvert.Checked;
      }
    }

    #endregion
  }
}